#example6_25_3d_scatter.py
#coding=utf-8
import matplotlib.pyplot as plt
import numpy as np

np.random.seed(1)
x = 5*np.random.rand(100)
np.random.seed(100)
y = 5*np.random.rand(100)+5
np.random.seed(10000)
z = 5*np.random.rand(100)+10

plt.rcParams['font.sans-serif'] = ['SimHei'] 
# 用来正常显示负号
plt.rcParams['axes.unicode_minus'] = False  
plt.rcParams['font.size']=15  #改变默认字体大小

fig = plt.figure(figsize=(6,6))
ax = fig.add_subplot(111, projection='3d') #创建三维坐标子图
ax.scatter(x, y, z)

ax.set_xlabel('X轴')
ax.set_ylabel('Y轴')
ax.set_zlabel('Z轴')
plt.show()